package com.baor.controller;

import com.baor.domain.ServiceVo;
import com.baor.service.ServiceService;
import com.baor.utils.AjaxResult;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/service")
public class ServiceController {

    @Autowired
    private ServiceService serviceService;

    @RequestMapping("serviceList")
    public AjaxResult<?> serviceList(@RequestBody Map<String, Object> params) {
        return serviceService.serviceList(params);
    }

    @RequestMapping("serviceInfo")
    public AjaxResult<?> serviceInfo(@RequestBody ServiceVo serviceVo) {
        return serviceService.serviceInfo(serviceVo);
    }

    @RequestMapping("insertService")
    public AjaxResult<?> insertService(@RequestBody ServiceVo serviceVo) {
        return serviceService.insertService(serviceVo);
    }

    @RequestMapping("updateService")
    public AjaxResult<?> updateService(@RequestBody ServiceVo serviceVo) {
        return serviceService.updateService(serviceVo);
    }

    @RequestMapping("deleteService")
    public AjaxResult<?> deleteService(@RequestBody ServiceVo serviceVo) {
        return serviceService.deleteService(serviceVo);
    }

    @RequestMapping("/serviceSelect")
    public AjaxResult<?> serviceSelect(@RequestBody Integer siteId) {
        return serviceService.serviceSelect(siteId);
    }
}
